package App.Repository;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by xw on 2019/5/14.
 */

@Repository
public class TecentIMRepository extends BaseRepository {


    @Transactional
    public int insertIMHistory(String apiType, String url, String requestJSON, String responseJSON) {
        int _result = 0;
        String _strSql = " insert into crm_tecent_im_history(recid,im_api_type,request_url,request_json,response_json,reccreator) " +
                " values(uuid(),:im_api_type,:request_url,:request_json,:response_json,1) ";

        Map<String, Object> _params = new HashMap<>();
        _params.put("im_api_type", apiType);
        _params.put("request_url", url);
        _params.put("request_json", requestJSON);
        _params.put("response_json", responseJSON);

        _result = updateEntity(_strSql, _params);
        return _result;

    }
}
